package com.ruoyi.consumer.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.consumer.mapper.CRequirementMapper;
import com.ruoyi.consumer.domain.CRequirement;
import com.ruoyi.consumer.service.ICRequirementService;

/**
 * requirementService业务层处理
 * 
 * @author ruoyi
 * @date 2023-11-13
 */
@Service
public class CRequirementServiceImpl implements ICRequirementService 
{
    @Autowired
    private CRequirementMapper cRequirementMapper;

    /**
     * 查询requirement
     * 
     * @param requireId requirement主键
     * @return requirement
     */
    @Override
    public CRequirement selectCRequirementByRequireId(Integer requireId)
    {
        return cRequirementMapper.selectCRequirementByRequireId(requireId);
    }

    /**
     * 查询requirement列表
     * 
     * @param cRequirement requirement
     * @return requirement
     */
    @Override
    public List<CRequirement> selectCRequirementList(CRequirement cRequirement)
    {
        return cRequirementMapper.selectCRequirementList(cRequirement);
    }

    /**
     * 新增requirement
     * 
     * @param cRequirement requirement
     * @return 结果
     */
    @Override
    public int insertCRequirement(CRequirement cRequirement)
    {
        cRequirement.setCreateTime(DateUtils.getNowDate());
        return cRequirementMapper.insertCRequirement(cRequirement);
    }

    /**
     * 修改requirement
     * 
     * @param cRequirement requirement
     * @return 结果
     */
    @Override
    public int updateCRequirement(CRequirement cRequirement)
    {
        cRequirement.setUpdateTime(DateUtils.getNowDate());
        return cRequirementMapper.updateCRequirement(cRequirement);
    }

    /**
     * 批量删除requirement
     * 
     * @param requireIds 需要删除的requirement主键
     * @return 结果
     */
    @Override
    public int deleteCRequirementByRequireIds(Integer[] requireIds)
    {
        return cRequirementMapper.deleteCRequirementByRequireIds(requireIds);
    }

    /**
     * 删除requirement信息
     * 
     * @param requireId requirement主键
     * @return 结果
     */
    @Override
    public int deleteCRequirementByRequireId(Integer requireId)
    {
        return cRequirementMapper.deleteCRequirementByRequireId(requireId);
    }
}
